#ifndef __PROTOCOL_H
#define __PROTOCOL_H	 
#include "sys.h"



typedef struct{
	char   PFC;
	char   sec;
	char   min;
	char   hour;
	char   day;
	char   allow_delay_time;
}Tp_t;

typedef struct{
	char   reserved;
	char   manufacturer_id;
	char   light_type;
	char   batch_number;
	char   device_id[3];
}Terminal_Id_t;

typedef struct{
	char   start_char1;
	short  length1;
	short  length2;
	char   start_char2;
}nb_data_struct_t1;


typedef struct{
	Terminal_Id_t   terminal_id;
	char   terminal_type;
	char   frame_attr[2];
	unsigned short  frame_serial_number;
}nb_data_struct_t2;


typedef struct{
	char   afn;
	char   seq;
	short  pn;
	short  fn;
}nb_data_struct_t3;


typedef struct{
	short  crc;
	char   end_char;
}nb_data_struct_t5;




/*在对接ok之前不考虑附加信息域*/
typedef struct{
	char   EC1;
	char   EC2;
}nb_data_struct_t4_1;

typedef struct{
	Tp_t   tp;
}nb_data_struct_t4_2;




















































extern unsigned char PFC;
extern char RSEQ;
extern nb_data_struct_t1	nb_data_1;
extern nb_data_struct_t2	nb_data_2;
extern nb_data_struct_t3	nb_data_3;
extern nb_data_struct_t5	nb_data_5;
#endif
